package jmine.tec.di.wrapper;

import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

import jmine.tec.annotations.Unmodifiable;

/**
 * Faz o 'wrap' para sortedmap
 * 
 * @author MarceloT
 */
@Unmodifiable
class SortedMapWrapper extends MapWrapper implements Wrapper {

    private static final long serialVersionUID = -7812049073025181040L;

    /**
     * {@inheritDoc}
     */
    @Override
    protected Map<Object, Object> newMap(int amount) {
        return new TreeMap<Object, Object>();
    }

    /**
     * Verifica se o tipo deste wrapper é compativel com o tipo de container passado
     * 
     * @param containerType Class
     * @return boolean
     */

    public boolean isTypeCompatible(Class<?> containerType) {
        return SortedMap.class.isAssignableFrom(containerType);
    }

}
